package com.me.domain;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Vet {
    private int id;
    private String name;
    private List<Speciality> specs;

    public List<Speciality> getSpecs() {
        if (specs == null) {
            specs = new ArrayList<>();
        }
        return specs;
    }

    public void setSpecs(List<Speciality> specs) {
        this.specs = specs;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String listToString() {
        if (specs == null) {
            return "专业为空";
        }
        StringBuilder str = new StringBuilder();
        for (Speciality s : specs) {
            str.append(" ").append(s.getName());
        }
        return str.toString();
    }
}
